import Vue from 'vue'
import Router from 'vue-router'
import layout from './views/layout'

Vue.use(Router)

export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [{
            path: '/',
            redirect: '/user/desktop',
        },
        {
            path: '/login',
            name: 'login',
            component: () =>
                import ( /* webpackChunkName: "login" */ './views/login.vue')
        }, {
            path: '/system',
            name: 'system',
            redirect: '/system/permission',
            component: layout,
            children: [{
                path: '/system/permission',
                name: 'system_permission',
                component: () =>
                    import ( /* webpackChunkName: "system_permission" */ './views/system/permission')
            }, {
                path: '/system/user',
                name: 'system_user',
                component: () =>
                    import ( /* webpackChunkName: "system_user" */ './views/system/user')
            }, {
                path: '/system/role',
                name: 'system_role',
                component: () =>
                    import ( /* webpackChunkName: "system_role" */ './views/system/role')
            }, {
                path: '/system/setting',
                name: 'system_setting',
                component: () =>
                    import ( /* webpackChunkName: "system_setting" */ './views/system/setting')
            }]
        }, {
            path: '/employee',
            name: 'employee',
            redirect: '/employee/employee',
            component: layout,
            children: [{
                path: '/employee/department',
                name: 'employee_department',
                component: () =>
                    import ( /* webpackChunkName: "employee_department" */ './views/employee/department')
            }, {
                path: '/employee/employee',
                name: 'employee_employee',
                component: () =>
                    import ( /* webpackChunkName: "employee_employee" */ './views/employee/employee')
            }]
        }, {
            path: '/form',
            name: 'form',
            redirect: '/form/template',
            component: layout,
            children: [{
                path: '/form/template',
                name: 'form_template',
                component: () =>
                    import ( /* webpackChunkName: "form_template" */ './views/form/template')
            }, {
                path: '/form/design',
                name: 'form_design',
                component: () =>
                    import ( /* webpackChunkName: "form_design" */ './views/form/design')
            }]
        }, {
            path: '/flow',
            name: 'flow',
            redirect: '/flow/template',
            component: layout,
            children: [{
                path: '/flow/template',
                name: 'flow_template',
                component: () =>
                    import ( /* webpackChunkName: "form_template" */ './views/flow/template')
            }, {
                path: '/flow/design',
                name: 'flow_design',
                component: () =>
                    import ( /* webpackChunkName: "form_design" */ './views/flow/design')
            }]
        }, {
            path: '/user',
            name: 'user',
            redirect: '/user/desktop',
            component: layout,
            children: [{
                path: '/user/desktop',
                name: 'user_desktop',
                component: () =>
                    import ( /* webpackChunkName: "user_desk" */ './views/user/desktop')
            }]
        },
    ]
})